-- GENERATED SPELL FOR [Hakkari Witch Doctor] --


function spell0_11831(pUnit, Event) --@Hex,n/a--
pUnit:FullCastSpellOnTarget(24053,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11831', 5298, 1)
end

function spell1_11831(pUnit, Event) --@Release Toads,Self--
pUnit:FullCastSpellOnTarget(24058,pUnit)
pUnit:RegisterEvent('Sorts_11831', 652, 1)
end

function spell2_11831(pUnit, Event) --@Shadow Shock,n/a--
pUnit:FullCastSpellOnTarget(17289,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11831', 589, 1)
end

function spell3_11831(pUnit, Event) --@Shrink,n/a--
pUnit:FullCastSpellOnTarget(24054,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11831', 1500, 1)
end

function Sorts_11831(pUnit, Event)
local choix_sorts_11831 = math.random(0, 3)
if choix_sorts_11831 == 0 then
pUnit:RegisterEvent('spell0_11831', 1, 1)
end
if choix_sorts_11831 == 1 then
pUnit:RegisterEvent('spell1_11831', 1, 1)
end
if choix_sorts_11831 == 2 then
pUnit:RegisterEvent('spell2_11831', 1, 1)
end
if choix_sorts_11831 == 3 then
pUnit:RegisterEvent('spell3_11831', 1, 1)
end
end

function mob11831_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11831', math.random(1500, 3000), 1)
end

function mob11831_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11831_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11831_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11831, 1, 'mob11831_Action')
RegisterUnitEvent(11831, 2, 'mob11831_Leave')
RegisterUnitEvent(11831, 3, 'mob11831_Kill')
RegisterUnitEvent(11831, 4, 'mob11831_Die')
